package com.ysjy.course.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.wkbb.common.handler.JsonUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@ApiModel("New消息")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class YsMessage implements Serializable {

    @ApiModelProperty(value = "ID")
    private Long id;
    @ApiModelProperty(value = "班级ID")
    private Long classId;
    @ApiModelProperty(value = "机构ID")
    private Long orgId;
    @ApiModelProperty(value = "发布人ID")
    private Long userId;
    @ApiModelProperty(value = "发布人名称")
    private String userName;
    @ApiModelProperty(value = "消息类型：1通知 2作业")
    private Integer type;
    @ApiModelProperty(value = "发布至 1所有人 2学校 3课班")
    private Integer showArea;
    @ApiModelProperty(value = "标题")
    private String title;
    @ApiModelProperty(value = "内容")
    private String content;
    @ApiModelProperty(value = "图片列表(最大9张)")
    private List<String> imgs;
    @ApiModelProperty(value = "阅读状态 1已读 0未读")
    private Integer readingState;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    public static void main(String[] args) {
        YsMessage data = new YsMessage();
        data.setType(1);
        data.setTitle("标题");
        data.setContent("内容");
        data.setClassId(18538L);
        List<String> imgs = new ArrayList<>();
        imgs.add("https://qiniu.righttimeedu.com/upload/RXFsGyDXTMJC微信图片_20210414104234.jpg");
        imgs.add("https://qiniu.righttimeedu.com/upload/RXFsGyDXTMJC微信图片_20210414104234.jpg");
        imgs.add("https://qiniu.righttimeedu.com/upload/RXFsGyDXTMJC微信图片_20210414104234.jpg");
        data.setImgs(imgs);
        System.out.println(JsonUtil.objectToJson(data));
    }
}